package me.huanmeng.heater.signalling.extra;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONSupport;
import lombok.Data;
import lombok.EqualsAndHashCode;
import me.huanmeng.heater.Heater;
import me.huanmeng.heater.bot.MessageHelper;
import me.huanmeng.heater.signalling.ChannelType;
import me.huanmeng.heater.signalling.ExtraType;

/**
 * 2021/9/28<br>
 * Heater<br>
 *
 * @author huanmeng_qwq
 */
@EqualsAndHashCode(callSuper = true)
@Data
public abstract class SignallingExtraData<T> extends JSONSupport implements MessageHelper {
    protected T type;

    public ChannelType getChannelType() {
        return ChannelType.GROUP;
    }

    public SignallingExtraData() {
    }

    @Override
    public JSONObject toJSON() {
        return super.toJSON();
    }

    public ExtraType getExtraType() {
        return ExtraType.get(type, getChannelType());
    }

    public void execute() {

    }

    @Override
    public String toJSONString() {
        return toJSON().toJSONString(Heater.getIndentFactor() * 3);
    }
}
